package com.cloud.pole.weixin.biz;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import com.ace.cache.annotation.Cache;
import com.cloud.pole.common.biz.BaseBiz;
import com.cloud.pole.mapper.WxAppMapper;
import com.cloud.pole.weixin.model.entity.WxApp;

/**
 * ${DESCRIPTION}
 *
 * @author wanghaobin
 * @create 2017-06-08 16:23
 */
@Service
@Transactional(rollbackFor = Exception.class)
public class WxAppBiz extends BaseBiz<WxAppMapper, WxApp> {
	
	@Autowired
	WxAppMapper wxAppMapper;
	
	@Cache(key="wxApp{1}")
    public WxApp selectByPrimaryKey(Integer id) {
		return wxAppMapper.selectByPrimaryKey(id);
    }
	
	@Cache(key="wxApp:appId{1}")
    public WxApp selectByAppId(String appId) {
		WxApp record = new WxApp();
		record.setAppId(appId);
		return wxAppMapper.selectOne(record);
    }
	
	@Cache(key="wxApp:originalId{1}")
    public WxApp selectByOriginalId(String originalId) {
		WxApp record = new WxApp();
		record.setOriginalId(originalId);
		return wxAppMapper.selectOne(record);
    }
}
